package com.weberror.frontendmonitoring.jsanomaly.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * js异常(Jsanomaly)表实体类
 *
 * @author cnxym
 * @since 2022-08-16 13:06:13
 */
@TableName(value = "jsanomaly")
public class Jsanomaly {
    //异常id
    @TableId(value = "jsanomaly_id", type= IdType.AUTO)
    private Integer jsanomalyId;
    //浏览器名字
    @TableField(value = "jsanomaly_browsername")
    private String jsanomalyBrowsername;
    //上报类型
    @TableField(value = "jsanomaly_type")
    private String jsanomalyType;
    //错误类型
    @TableField(value = "jsanomaly_errortype")
    private String jsanomalyErrortype;
    //js异常时间
    @TableField(value = "jsanomaly_time")
    private String jsanomalyTime;
    //当前路径
    @TableField(value = "jsanomaly_path")
    private String jsanomalyPath;
    //资源异常
    @TableField(value = "jsanomaly_src")
    private String jsanomalySrc;

    public Integer getJsanomalyId() {
        return jsanomalyId;
    }

    public void setJsanomalyId(Integer jsanomalyId) {
        this.jsanomalyId = jsanomalyId;
    }

    public String getJsanomalyBrowsername() {
        return jsanomalyBrowsername;
    }

    public void setJsanomalyBrowsername(String jsanomalyBrowsername) {
        this.jsanomalyBrowsername = jsanomalyBrowsername;
    }

    public String getJsanomalyType() {
        return jsanomalyType;
    }

    public void setJsanomalyType(String jsanomalyType) {
        this.jsanomalyType = jsanomalyType;
    }

    public String getJsanomalyErrortype() {
        return jsanomalyErrortype;
    }

    public void setJsanomalyErrortype(String jsanomalyErrortype) {
        this.jsanomalyErrortype = jsanomalyErrortype;
    }

    public String getJsanomalyTime() {
        return jsanomalyTime;
    }

    public void setJsanomalyTime(Object jsanomalyTime) {
        if (jsanomalyTime instanceof Date) {
            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            Date date = (Date) jsanomalyTime;
            this.jsanomalyTime = dateFormat.format(date);
        } else if (jsanomalyTime instanceof String) {
            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            Date date = new Date(Long.parseLong((String) jsanomalyTime));
            this.jsanomalyTime = dateFormat.format(date);
        }
    }

    public String getJsanomalyPath() {
        return jsanomalyPath;
    }

    public void setJsanomalyPath(String jsanomalyPath) {
        this.jsanomalyPath = jsanomalyPath;
    }

    public String getJsanomalySrc() {
        return jsanomalySrc;
    }

    public void setJsanomalySrc(String jsanomalySrc) {
        this.jsanomalySrc = jsanomalySrc;
    }
}

